package com.antcom.antread.antreaddatacrawl.himalayaData.dao.repository;

import com.antcom.antread.antreaddatacrawl.himalayaData.entity.ChapterInfo;
import feign.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * dao ChapterInfoRepository
 *
 * @Author 中国蚂蚁技术有限公司
 * @create 2020/12/5 16:56
 */
public interface ChapterInfoRepository extends JpaRepository<ChapterInfo, String> {

    List<ChapterInfo> findByChapterSign(@Param("chapterSign") String chapterSign);

    @Query(value = "SELECT * from xmlachapterinfo t where t.chapter_sign = ?1 LIMIT ?2,?3", nativeQuery = true)
    List<ChapterInfo> findListChapter(String sign, Integer start, Integer end);

    ChapterInfo findByChapterNameLikeAndChapterSign(@Param("chapterName")String chapterName,@Param("chapterSign")String chapterSign);

}
